package com.ZengQi.event.service.impl;

import com.ZengQi.event.dao.CommentDao;
import com.ZengQi.event.dao.impl.CommentDaoImpl;
import com.ZengQi.event.entity.Comment;
import com.ZengQi.event.service.CommentService;

import java.util.List;

public class CommentServiceImpl implements CommentService {
    private final CommentDao commentDao=new CommentDaoImpl();
    @Override
    public boolean saveComment(Comment comment) {

        return commentDao.insertComment(comment);
    }

    @Override
    public List<Comment> findListComment(Comment conditionComment) {
        return commentDao.listComments(conditionComment);
    }

    @Override
    public boolean removeComment(Comment conditionComment) {
        return commentDao.deleteComment(conditionComment);
    }

    @Override
    public boolean modifyCommentByCommentPublisher(Comment comment,String oldCommentPublisher) {
        return commentDao.updateCommentByCommentPublisher(comment,oldCommentPublisher);
    }

    @Override
    public List<Comment> allList() {
        return commentDao.allComment();
    }
}
